package com.yue.design.prototype;

public class Test {
    public static void main(String[] args) {
        Student s = new Student();
        s.setAge(12);
        s.setName("小明");
        s.setSchool(new School("实验小学"));
        Student clone = null;
        try {
            clone = s.clone();
            clone.setName("小亮");
            clone.getSchool().setName("一小");
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(s.toString());
        System.out.println(clone.toString());
    }
}
